/**
 * Copyright(c) 2014 Xunton Solutions
 *
 * History:
 *   15-12-14 下午9:00 Created by dwzhang
 */
package com.jade.bss.ec.ware;

import javax.persistence.*;

/**
 * 针对具体的分类或者商品，自定义规格的名称，例如不叫颜色，尺寸，叫做套餐、容量、规格等等。
 *
 * @author <a href="mailto:dwzhang@xunton.com">dwzhang</a> 
 * @version 1.0 15-12-14 下午9:00
 */
@Entity
@Table (name = "BSS_EC_WARE_SPEC")
public class WareSpecDefine
{
    @Id
    @GeneratedValue (generator = "BSS_SEQ_EC_WARE_SPEC_DEFINE")
    @SequenceGenerator (name = "BSS_SEQ_EC_WARE_SPEC_DEFINE", sequenceName = "BSS_SEQ_EC_WARE_SPEC_DEFINE")
    private long id;
    //所有者类型，不同的所有者可以定义自身的商品规格
    @Column (name = "owner_type", length = 32, nullable = false, updatable = false)
    private String ownerType;
    //所有者
    @Column (name = "owner_id", length = 64, nullable = false, updatable = false)
    private String ownerId;
    //商品所属分类
    @Column (name = "cid", nullable = false, updatable = false)
    private long cid;
    //为空表示该规格定义在分类上，否则为商品自定义的规格。一般颜色或者尺寸的规格由分类统一定义好
    @Column (name = "ware_id", updatable = false)
    private long wareId;
    //颜色/尺码/自定义规格
    @Column (name = "type", updatable = false)
    private int type = WareSpec.TYPE_COLOR;
    @Column (name = "name", length = 64, nullable = false)
    private String name;

    public long getId()
    {
        return id;
    }

    public void setId(long id)
    {
        this.id = id;
    }

    public String getOwnerType()
    {
        return ownerType;
    }

    public void setOwnerType(String ownerType)
    {
        this.ownerType = ownerType;
    }

    public String getOwnerId()
    {
        return ownerId;
    }

    public void setOwnerId(String ownerId)
    {
        this.ownerId = ownerId;
    }

    public long getCid()
    {
        return cid;
    }

    public void setCid(long cid)
    {
        this.cid = cid;
    }

    public long getWareId()
    {
        return wareId;
    }

    public void setWareId(long wareId)
    {
        this.wareId = wareId;
    }

    public int getType()
    {
        return type;
    }

    public void setType(int type)
    {
        this.type = type;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }
}
